// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,

    properties: {
        lbTip: cc.Label,
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    setTip(tip) {
        this.lbTip.string = tip + "";

        this.node.setPosition(cc.v2(0, 0));
        this.node.opacity = 255;
        cc.tween(this.node).delay(1).to(0.5, { y: 100, opacity: 0 }).call(() => {
            this.node.destroy();
        }).start();
    }

    // update (dt) {},
});
